# 暂时用于调整cm
from model.charModelUtil.util import *
from dataAccess import getData
# tools
def toRateList(l,length):
	for x in range(len(l)):
		l[x] = round(l[x]/length,3)
	return l

ICDList = [1.8465447154471544, 3.426321138211382, 2.4029471544715446, 0.9110772357723578, 0.01524390243902439, 0.00001]
# arg_cp = getData.getGood("normalparams","cp","limit 1,60")
arg_dni = getData.getGood("normalparams","dni","limit 1,60")
arg_password = getData.getGood("normalparams","password","limit 1,60")
arg_password = sorted(arg_password,key = lambda x :len(x))
# print("wxtonline7888976",len("wxtonline7888976"),getDistribute("wxtonline7888976",strategyNum=1,userStrategy=None))
# print("abcda",len("abcda"),getDistribute("abcda",strategyNum=1,userStrategy=None))
# print("<==================>")
# for x in arg_cp:
# 	temp = getDistribute(x,strategyNum=1, userStrategy=None)
# 	print(x,len(x),toRateList(temp.copy(),len(x)),"<=====>",temp)
# print("<==================>")
# for x in arg_dni:
# 	temp = getDistribute(x,strategyNum=1, userStrategy=None)
# 	print(x,len(x),toRateList(temp.copy(),len(x)),"<=====>",temp)
# print("<==================>")
# for x in arg_password:
# 	temp = getDistribute(x,strategyNum=1, userStrategy=None)
# 	print(x,len(x),toRateList(temp.copy(),len(x)),"<=====>",temp)
x = "123eqw"
temp = getDistribute(x,strategyNum=1, userStrategy=None)
print(x,len(x),toRateList(temp.copy(),len(x)),"<=====>",temp)
print(chi2Rst(ICDList,temp))